﻿#define _CRT_SECURE_NO_WARNINGS
#include"SList.h"

//void Test1()
//{
//	SLTNode* node1 = (SLTNode*)malloc(sizeof(SLTNode));
//	assert(node1);
//	node1->data = 1;
//	SLTNode* node2 = (SLTNode*)malloc(sizeof(SLTNode));
//	assert(node2);
//	node2->data = 2;
//	SLTNode* node3 = (SLTNode*)malloc(sizeof(SLTNode));
//	assert(node3);
//	node3->data = 3;
//	SLTNode* node4 = (SLTNode*)malloc(sizeof(SLTNode));
//	assert(node4);
//	node4->data = 4;
//	
//	node1->next = node2;
//	node2->next = node3;
//	node3->next = node4;
//	node4->next = NULL;
//
//	SLTNode* plist = node1;
//	SLTPrint(plist);
//}

//void Test2()
//{
	//测试空链表实现尾插
	//SLTNode* plist = NULL;
	//SLTPrint(plist);
	//SLTPushBack(&plist, 1);
	//SLTPrint(plist);
	//SLTPushBack(&plist, 2);
	//SLTPrint(plist);
	//SLTPushBack(&plist, 3);
	//SLTPrint(plist);
	//SLTPushBack(&plist, 4);
	//SLTPrint(plist);
	//头插（初始链表为空不影响头插操作）
	//SLTPushFront(&plist, 0);
	//SLTPrint(plist);
	//SLTPushFront(&plist, 9);
	//SLTPrint(plist);
	//尾删
	//SLTPopBack(&plist);
	//SLTPrint(plist);
	//SLTPopBack(&plist);
	//SLTPrint(plist);
	//头删
	//SLTPopFront(&plist);
	//SLTPrint(plist);
	//SLTPopFront(&plist);
	//SLTPrint(plist); 
	//SLTPopFront(&plist);
	//SLTPrint(plist); 
	//查找
	//SLTNode* find=SLTFind(plist, 9);
	//if (find)
	//{
	//	printf("找到啦！\n");
	//	SLTPrint(find);
	//}
	//else
	//	printf("没有相关数据！\n");
	//在目标节点前插入数据
	//SLTInsert(&plist, find,88);
	//SLTPrint(plist); 

	//SLTNode* find1 = SLTFind(plist, 3);
	////SLTErase(&plist, find1);
	////SLTPrint(plist);
	//SLTInsertAfter(find1, 22);
	//SLTPrint(plist);

	//SLTEraseAfter(find);
	//SLTPrint(plist);

	//SListDesTroy(&plist);
	//SLTPrint(plist);
//}


int main()
{
	//Test1();	
	//Test2();	
	return 0;
}